import java.util.Scanner;

public class reverse {
    public static void main(String[] args) {
        //2135  >>>  贰壹叁务
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个数字(ps:1~7位)");
        while (true) {
            int number = sc.nextInt();
            if (number >= 0 && number <= 9999999) {
                String c = reverseChia(number);
                int wei = addZero(number);
                for (int i = 0; i < wei; i++) {
                    c = "零" + c;
                }
                String[] arr = {"佰","拾","万","仟","佰","拾","元"};
                for (int i = 0; i < c.length(); i++) {
                   char a = c.charAt(i);
                    System.out.print(a);
                    System.out.print(arr[i]);
                }

                break;
            } else {
                System.out.println("输入数字超出范围,请重新输入");
            }

        }

    }

    public static String reverseChia(int number) {
        String[] China = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"};
        String chinaNumber = "";
        while (true) {
            int ge = number % 10;
            chinaNumber = China[ge] + chinaNumber;
            number = number / 10;
            if (number == 0) {
                break;
            }
        }


        return chinaNumber;
    }

    public static int addZero(int number) {
        int count = 0;
        while (true) {
            number = number / 10;
            count++;
            if (number == 0) {
                count = 7 - count;
                break;
            }

        }
        return count;
    }


}
